package
{
	import flash.display.DisplayObject;

	import nape.geom.Vec2;
	import nape.phys.Body;
	import nape.phys.BodyType;
	import nape.shape.Polygon;
	import nape.space.Space;

	public final class NapeUtils
	{
		/**
		 *根据给定的Mc,生成对应的物理静态刚体(不参与物理运动)
		 *
		 * @param _mc			MC元件,注意! 该元件需要已经添加舞台上面(会读取其坐标)
		 * @param _space		物理元件所属的物理空间
		 *
		 */
		public static function createStaticBoxBodyByMc(_mc:DisplayObject, _space:Space):void
		{
			var body:Body=new Body(BodyType.STATIC, new Vec2(_mc.x, _mc.y));
			var shape:Polygon=new Polygon(Polygon.box(_mc.width, _mc.height));
			body.shapes.add(shape);
			body.space=_space;
		}

		public function NapeUtils()
		{
		}
	}
}
